package com.fr.schedule.web;

import com.fr.schedule.entry.SAPSynManager;
import com.fr.web.core.ActionNoSessionCMD;
import com.fr.web.utils.WebUtils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;

public class ScheduleSAPSynStateAction extends ActionNoSessionCMD {
	
	public void actionCMD(HttpServletRequest req, HttpServletResponse res)
			throws Exception {
		PrintWriter printWriter = WebUtils.createPrintWriter(res);
		String taskIdString = req.getParameter("taskId");
		long taskId = Long.parseLong(taskIdString);
		int state = SAPSynManager.stateJob(taskId);
		printWriter.print(state);
		printWriter.flush();
		printWriter.close();
	}

	public String getCMD() {
		return "se_state_st_job";
	}
}
